/*
 * Copyright 2010 (c) Dou Yongwang (douyongwang@gmail.com)
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

#ifndef FACEBOOKOBJECT_H
#define FACEBOOKOBJECT_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>

// CLASS DECLARATION

class CFacebookObject;
typedef RPointerArray<CFacebookObject> RFacebookObjectArray;

/**
 *  CFacebookObject
 *
 */
class CFacebookObject : public CBase
	{
public:
	// Constructors and destructor
	~CFacebookObject();
	IMPORT_C static CFacebookObject* NewL(TAny* aJObjectObject);
	IMPORT_C static CFacebookObject* NewLC(TAny* aJObjectObject);

public:
	// return KErrNone if found,
	//        KErrNotFound if not found,
	//        KErrNotSupported if no implementation yet
//	TInt getInt32(const TDesC8& aField, TInt32& aVal) const;
//	void getInt32L(const TDesC8& aField, TInt32& aVal) const;
	IMPORT_C TInt getInt64(const TDesC8& aField, TInt64& aVal) const;
	void getInt64L(const TDesC8& aField, TInt64& aVal) const;
	IMPORT_C TInt getBool(const TDesC8& aField, TBool& aValue) const;
	void getBoolL(const TDesC8& aField, TBool& aValue) const;
	IMPORT_C TInt getUtf8String(const TDesC8& aField, TPtrC8& aValue) const;
	void getUtf8StringL(const TDesC8& aField, TPtrC8& aValue) const;
	IMPORT_C TInt getArray(const TDesC8& aField, RFacebookObjectArray& aValue) const;
	void getArrayL(const TDesC8& aField, RFacebookObjectArray& aValue) const;
	IMPORT_C TInt getObject(const TDesC8& aField, CFacebookObject& aValue) const;
	void getObjectL(const TDesC8& aField, CFacebookObject& aValue) const;

protected:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CFacebookObject();

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL(TAny* aJObjectObject);

	void SetJSONObject(TAny* aJSONObject);

private:
	struct PImpl;
	PImpl* iPimpl;
	};

#include "FacebookObject.inl"

#endif // FACEBOOKOBJECT_H
